package com.hotel_management_backstage.lin.dao;

import com.hotel_management_backstage.lin.entity.SysUserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SysUserRoleMapper {
    @Select("SELECT * FROM sys_user_role WHERE user_id = #{userId}")
    List<SysUserRole> listByUserId(Integer userId);

    SysUserRole selectByUserId(Integer userId);

    void insertUserRole(@Param("userId") Integer userId, @Param("roleId") Integer roleId);

    void updateUserRole(@Param("userId") Integer userId, @Param("roleId") Integer roleId);

    void deleteSysUserRoleByUserId(Integer userId);
}
